<?php 
/**
 * Organization Access form page. Used in create and update action in OrganizationAccessController.
 *
 * @package   views
 * @subpackage organizationAccess
 * @since     1.0
 * @filesource
 */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'organization-access-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'organizationId'); ?>
		<?php 
			if ($model->isNewRecord)
				echo $form->dropDownList($model,'organizationId', CHtml::listData(Organization::model()->active()->findAll(),'id','name')); 
			else
				echo CHtml::link($model->organization->name,array('organization/update','id'=>$model->organizationId),
					array('target'=>'_blank'));
		?>
		<?php echo $form->error($model,'organizationId'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'accessCreate'); ?>
		<?php echo $form->checkBox($model,'accessCreate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'accessView'); ?>
		<?php echo $form->checkBox($model,'accessView'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'accessDownload'); ?>
		<?php echo $form->checkBox($model,'accessDownload'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'accessUpdate'); ?>
		<?php echo $form->checkBox($model,'accessUpdate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'accessDelete'); ?>
		<?php echo $form->checkBox($model,'accessDelete'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->